package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;

class Solution1466 {
    public int minReorder(int n, int[][] connections) {
        return GraphUtils.minReorder(n, connections);
    }
}

public class leetcode1466 {
    public static void main(String[] args) {
        Solution1466 solution1466 = new Solution1466();

        int n = 6;
        int[][] connections = {{0, 1}, {1, 3}, {2, 3}, {4, 0}, {4, 5}};
        System.out.println(solution1466.minReorder(n, connections));

        int n1 = 5;
        int[][] connections1 = {{1, 0}, {1, 2}, {3, 2}, {3, 4}};
        System.out.println(solution1466.minReorder(n1, connections1));

        int n2 = 3;
        int[][] connections2 = {{1, 0}, {2, 0}};
        System.out.println(solution1466.minReorder(n2, connections2));
    }
}
